<!-- include tpl=head_lay -->
<style type="text/css">
.cate-ext .layui-form-label{
	padding-top:0;
}
</style>
<form method="post" id="post_save" class="layui-form" onsubmit="return $.admin_cate.save()">
<!-- if $id --><input type="hidden" id="id" name="id" value="{$id}" /><!-- /if -->
<div class="layui-fluid layui-bg-white">
	<div class="layui-tab layui-tab-brief">
		<ul class="layui-tab-title">
			<li class="layui-this">{lang基本设置}</li>
			<li>{lang分类属性}</li>
			<li>{langSEO优化}</li>
			<li>{lang扩展内容}</li>
		</ul>
		<div class="layui-tab-content">
			<div class="layui-tab-item layui-show">
				<div class="layui-card-body">
					<input type="hidden" name="style" id="style" value="{$rs.style}" />
					<div class="layui-form-item">
						<label class="layui-form-label">{lang分类名称}</label>
						<div class="layui-input-block">
							<div class="layui-col-md10">
								<input type="text" id="title" name="title" class="layui-input" value="{$rs.title}" style="{$rs.style}" placeholder="{lang在前台显示的名称信息}" />
							</div>
							<div class="layui-col-md1" style="margin-left:10px;">
								<button type="button" class="layui-btn layui-btn-sm" onclick="phpok_admin_style('style','title')">
									<i class="layui-icon">&#xe64e;</i> {lang样式}
								</button>
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							<i class="layui-icon layui-tips" lay-tips="{lang字母、数字、下划线或中划线且必须是字母开头}">&#xe702;</i>
							{lang标识}
						</label>
						<div class="layui-input-inline default">
							<input type="text" id="identifier" name="identifier" class="layui-input" value="{$rs.identifier}" />
						</div>
						<div class="layui-input-inline auto" id="HTML-POINT-PHPOK-IDENTIFIER"></div>
					</div>
					<!-- if $parent_id -->
					<div class="layui-form-item">
						<label class="layui-form-label">{lang父级分类}</label>
						<div class="layui-input-block">
							<select name="parent_id" id="parent_id">
								<!-- loop from=$parentlist key=$key value=$value id=$tmpid -->
								<option value="{$value.id}"{if $value.id == $parent_id} selected{/if}>{$value._space}{$value.title}</option>
								<!-- /loop -->
							</select>
						</div>
					</div>
					<!-- else -->
					<div class="layui-form-item">
						<label class="layui-form-label">
							{lang模块}
						</label>
						<div class="layui-input-inline default-auto">
							<select name="module_id" id="module_id">
								<option value="">{lang请选择模块}</option>
								<!-- loop from=$mlist key=$key value=$value id=$tmpid -->
								<option value="{$value.id}"{if $value.id == $rs.module_id} selected{/if}>{$value.title}</option>
								<!-- /loop -->
							</select>
						</div>
						<div class="layui-form-mid">
							{lang绑定模块后，如果已添加了子分类，绑定的模块不能更新}
						</div>
					</div>
					<!-- /if -->
					<div class="layui-form-item">
						<label class="layui-form-label">{lang排序}</label>
						<div class="layui-input-inline">
							<input type="number" id="taxis"  name="taxis" max="255" min="0" class="layui-input" value="{$rs.taxis ? $rs.taxis : 255}" />
						</div>
						<div class="layui-input-inline auto">{lang值越小越往前靠，最小值为0，最大值为255}</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">{lang状态}</label>
						<div class="layui-input-block">
							<input type="radio" name="status" value="0" title="{lang禁用}"{if $id && !$rs.status} checked{/if} />
			      			<input type="radio" name="status" value="1" title="{lang使用}" {if !$id || $rs.status} checked{/if} />
						</div>
					</div>
				</div>
			</div>
			<div class="layui-tab-item">
				<div class="layui-card-body">
					<div class="layui-form-item">
						<label class="layui-form-label">{lang默认主题数}</label>
						<div class="layui-input-inline">
							<input type="number" id="psize" min="0" max="999" name="psize" value="{$rs.psize}" class="layui-input" />
						</div>
						<div class="layui-input-inline auto">{lang启用此项将替换项目中的设置，设为0表示读取项目中的设置}</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">{lang API 默认数}</label>
						<div class="layui-input-inline">
							<input type="number" id="psize_api" min="0" max="999" name="psize_api" value="{$rs.psize_api}" class="layui-input" />
						</div>
						<div class="layui-input-inline auto">{lang启用此项将替换项目中的设置，设为0表示读取项目中的设置}</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">{lang列表模板}</label>
						<div class="layui-input-inline default">
							<input type="text" id="tpl_list" name="tpl_list" class="layui-input" value="{$rs.tpl_list}" />
						</div>
						<div class="layui-input-inline auto">
							<div class="layui-btn-group">
								<input type="button" value="{lang选择}" onclick="phpok_tpl_open('tpl_list')" class="layui-btn" />
								<input type="button" value="{lang清空}" onclick="$('#tpl_list').val('');" class="layui-btn layui-btn-danger" />
							</div>
						</div>
						<div class="layui-input-inline auto">{lang此处设置自定义模板，将替代项目中的模板设置}</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">{lang内容模板}</label>
						<div class="layui-input-inline default">
							<input type="text" id="tpl_content" name="tpl_content" class="layui-input" value="{$rs.tpl_content}" />
						</div>
						<div class="layui-input-inline auto">
							<div class="layui-btn-group">
								<input type="button" value="{lang选择}" onclick="phpok_tpl_open('tpl_content')" class="layui-btn" />
								<input type="button" value="{lang清空}" onclick="$('#tpl_content').val('');" class="layui-btn layui-btn-danger" />
							</div>
						</div>
						<div class="layui-input-inline auto">{lang此处设置自定义模板，将替代项目中的模板设置}</div>
					</div>
					<!-- if $popedom.ext && $extfields && !$parent_id -->
					<div class="layui-form-item">
						<label class="layui-form-label layui-tips" lay-tips="{lang此项用于配置默认的子项扩展字段属性，留空表示不添加子分类扩展字段}">{lang子类扩展}</label>
						<div class="layui-input-block">
							<!-- loop from=$extfields key=$key value=$value id=$tmpid -->
							<input type="checkbox" name="_extfields[]" value="{$key}"{if $ext2 && in_array($key,$ext2)} checked{/if} lay-skin="primary" title="{$value.title}" />
							<!-- /loop -->
						</div>
					</div>
					<!-- /if -->
				</div>
			</div>
			<div class="layui-tab-item">
				<div class="layui-card-body">
					<div class="layui-form-item">
						<label class="layui-form-label">{langSEO标题}</label>
						<div class="layui-input-inline long">
							<input type="text" id="seo_title" name="seo_title" class="layui-input" value="{$rs.seo_title}" />
						</div>
						<div class="layui-input-inline auto">{lang设置此标题后，网站Title将会替代默认定义的，不能超过85个汉字}</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">{langSEO关键字}</label>
						<div class="layui-input-inline long">
							<input type="text" id="seo_keywords" name="seo_keywords" class="layui-input" value="{$rs.seo_keywords}" />
						</div>
						<div class="layui-input-inline auto">{lang多个关键字用英文逗号或英文竖线隔开}</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">{langSEO描述}</label>
						<div class="layui-input-inline long">
							<textarea name="seo_desc" id="seo_desc" class="layui-textarea">{$rs.seo_desc}</textarea>
						</div>
						<div class="layui-input-inline auto">{lang简单描述该主题信息，不支持HTML，不能超过85个汉字}</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">{lang标签Tag}</label>
						<div class="layui-input-inline long">
							<input type="text" id="tag" name="tag" class="layui-input" value="{$rs.tag}" />
						</div>
						<div class="layui-input-inline auto">{lang多个标签用 [title] 分开，最多不能超过10个|title:$tag_config.separator}</div>
					</div>
				</div>
			</div>
			<div class="layui-tab-item">
				<div class="layui-card-body">
					<!-- loop from=$clist key=$key value=$value id=$tmpid -->
					<div class="layui-form-item">
						<label class="layui-form-label" style="padding-top:0;">
							{$value.title}<div class="darkblue"><small>[{$value.identifier}]</small></div>
						</label>
						<!-- if $value.note --><div class="layui-input-block gray">{$value.note}</div><!-- /if -->
						<div class="layui-input-block">{$value.html}</div>
					</div>
					<!-- /loop -->
					<!-- loop from=$extlist key=$key value=$value id=$tmpid -->
					<div class="layui-form-item cate-ext">
						<label class="layui-form-label">
							<!-- if $value.note && ($value.admin-note-show == 1 || $value.admin-note-show == 3 || $value.admin-note-show == 4) -->
							<i class="layui-icon layui-tips" lay-tips="{$value.note}">&#xe702;</i>
							<!-- /if -->
							{$value.title}
							<small style="color:#ccc;display:block;">{$value.identifier}</small>
						</label>
						<!-- if $value.note && $value.admin-note-show == 2 -->
						<div class="layui-input-block gray">{$value.note}</div>
						<!-- /if -->
						<div class="layui-input-block">{$value.html}</div>
						<!-- if $value.note && $value.admin-note-show == 5 -->
						<div class="layui-input-block gray">{$value.note}</div>
						<!-- /if -->
						<!-- if $popedom.ext && $session.adm_develop -->
						<div class="layui-input-block mtop">
							<div class="layui-btn-group">
								<!-- if $ext_module != 'add-cate' -->
								<input type="button" value="{lang编辑}" class="layui-btn layui-btn-xs" onclick="ext_edit('{$value.identifier}','{$ext_module}')" />
								<!-- /if -->
								<input type="button" value="{lang删除}" class="layui-btn layui-btn-xs layui-btn-danger" onclick="ext_delete('{$value.identifier}','{$ext_module}','{$value.title}')" />
							</div>
						</div>
						<!-- /if -->
					</div>
					<!-- /loop -->
					<!-- if $popedom.ext && $session.adm_develop -->
					<div class="layui-form-item">
						<label class="layui-form-label">{lang扩展字段}</label>
						<div class="layui-input-inline default">
							<select id="_tmp_select_add" style="padding:3px">
								<option value="">{lang请选择要添加的扩展字段…}</option>
								<!-- loop from=$extfields key=$key value=$value -->
								<!-- if !$used_fields || ($used_fields && !in_array($value.identifier,$used_fields)) -->
								<option value="{$value.identifier}">{$value.title} - {$value.identifier}</option>
								<!-- /if -->
								<!-- /loop -->
							</select>
						</div>
						<div class="layui-input-inline auto">
							<div class="layui-btn-group">
								<input type="button" value="{lang快速添加}" onclick="$.admin_cate.ext_add('{$ext_module}')"  class="layui-btn" />
								<input type="button" value="{lang创建新的扩展字段}" onclick="ext_add('{$ext_module}')" class="layui-btn" />
							</div>
						</div>
					</div>
					<!-- /if -->
				</div>
			</div>
		</div>
	</div>
</div>

<div class="submit-info-clear"></div>
<div class="submit-info">
	<div class="layui-container center">
		<input type="submit" value="{lang提交}" class="layui-btn layui-btn-lg layui-btn-danger" />
		<input type="button" value="{lang取消关闭}" class="layui-btn layui-btn-lg layui-btn-primary" onclick="$.admin.close()" />
	</div>
</div>
</form>

<!-- include tpl=foot_lay -->